package com.xiaoyy.sso.common.enums;

public enum LoginTypeEnum {
    username("username","账号密码"),
    cellphone("cellphone","手机验证码"),
    email("email","邮箱验证码"),
    weixin("weixin","微信"),
    alipay("alipay","支付宝"),
    dingding("dingding","钉钉"),
    qq("qq","qq登入");
    private String type;
    private String name;

    LoginTypeEnum(String type, String name) {
        this.type = type;
        this.name = name;
    }

    public String getType() {
        return this.type;
    }

    public String getName() {
        return this.name;
    }

    public static LoginTypeEnum getByType(String type) {

        for (LoginTypeEnum typeEnum : values()) {
            if (typeEnum.getType() .equals(type) ) {
                return typeEnum;
            }
        }
        return null;
    }
}
